package com.lumyc.store.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class  JsonResult<E> implements Serializable {

    private int state;
    private String message;
    private E data;

    public JsonResult(int state) {
        this.state = state;
    }

    public JsonResult(int state, E data) {
        this.state = state;
        this.data = data;
    }

    public JsonResult(Throwable e) {
        this.message = e.getMessage();
    }
}
